import { FC } from "react";

// 引入自定义hook
import useCounter from "../useCounter";
const UseCustomHook:FC<any>=()=>{
    let [count,method]=useCounter(100)
    return(
        <fieldset>
            <legend>使用自定义hook</legend>
            <button onClick={()=>{
                method.increase(1)
            }}>+</button>
            --
            <b>{count}</b>
            --
            <button onClick={()=>{
                method.decrease(2)
            }}>-</button>
        </fieldset>
    )
}

export default UseCustomHook